<?php
/** Tiehui.Lu (Danny.Lu) dannyteihui@hotmail.com utf-8 [2008-11-26 上午09:39:55] */
/*
 * Example is a simple class that stores an arbitrary 
 * number of named properties. 
 */

class Example {
    private $catalog = array();
    
    public function SetProperties( $arrayVariables ) {
        foreach ( $arrayVariables as $name => $value ) {
            $this->SetProperty( $name, $value );
        }
    }
    
    public function SetProperty( $name, $value ) {
        $this->$name = $value;
        $this->catalog[] = $name;
    }
    
    public function GetProperties() {
        $result = array();
        foreach ( $this->catalog as $name ) {
            $result[$name] = $this->GetProperty( $name );
        }        
        return( $result );
    }
    
    public function GetProperty( $name ) {
        return ( $this->$name );
    }
}
?>